package com.ihr360.rest.service;

import com.ihr360.commons.entity.AuthUserInfo;
import com.ihr360.oneclick.modal.OneClickStaff;
import com.ihr360.oneclick.modal.SendMessage;
import com.ihr360.oneclick.modal.SendMessageResponse;
import com.ihr360.rest.service.fallback.IrenshiDubboProviderServiceFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * irenshi dubbo provider
 *
 * @author tom
 * @date 17-6-21
 */

@FeignClient(name = "irenshi-dubbo-provider", path = "/", fallback = IrenshiDubboProviderServiceFallback.class)
public interface IrenshiDubboProviderService {

    @RequestMapping(value = "/user/company/name", method = RequestMethod.GET)
    String getCompanyName(@RequestParam(value = "companyId") String companyId);

    @RequestMapping(value = "/sms/company/balance/sufficient", method = RequestMethod.GET)
    boolean balanceSufficient(@RequestParam(value = "companyId") String companyId, @RequestParam(value = "smsCount") int smsCount);

    @RequestMapping(value = "/sms/send/batch", method = RequestMethod.POST)
    SendMessageResponse sendSms(@RequestBody Set<SendMessage> sendMessages,
                                @RequestParam(value = "companyId") String companyId,
                                @RequestParam(value = "userId") String userId,
                                @RequestParam(value = "withoutCharge") boolean withoutCharge);

    @RequestMapping(value = "/user/check/password", method = RequestMethod.POST)
    boolean checkCompanyPassword(@RequestBody AuthUserInfo authUserInfo, @RequestParam(value = "password") String password);

    @RequestMapping(value = "/appUser/program/Id/map", method = RequestMethod.POST)
    Map<String, String> getAppUserRecordProgramId(@RequestBody List<OneClickStaff> oneClickStaffList);

    @RequestMapping(value = "/appUser/service/Id/map", method = RequestMethod.POST)
    Map<String, String> getAppUserRecordServiceId(@RequestBody List<OneClickStaff> oneClickStaffList);
}

